import axios from "~/axios";
//banner
export function getBanner(page) {
  return axios.get("/banner?page=" + page);
}

export function createBanner(data) {
  return axios.post("/banner", data);
}

export function updateBanner(id, data) {
  return axios.put(`/banner/${id}`, data);
}

export function deleteBanner(id) {
  return axios.delete(`/banner/${id}`);
}
//about
export function getAbout(page) {
  return axios.get("/about?page=" + page);
}

export function createAbout(data) {
  return axios.post("/about", data);
}

export function updateAbout(id, data) {
  return axios.put(`/about/${id}`, data);
}

export function deleteAbout(id) {
  return axios.delete(`/about/${id}`);
}
//service
export function getService(page) {
  return axios.get("/service?page=" + page);
}

export function createService(data) {
  return axios.post("/service", data);
}

export function updateService(id, data) {
  return axios.put(`/service/${id}`, data);
}

export function deleteService(id) {
  return axios.delete(`/service/${id}`);
}
//query
export function getQuery(page) {
  return axios.get("/query?page=" + page);
}

export function createQuery(data) {
  return axios.post("/query", data);
}

export function updateQuery(id, data) {
  return axios.put(`/query/${id}`, data);
}

export function deleteQuery(id) {
  return axios.delete(`/query/${id}`);
}
//config 配置

export function getConfig() {
  return axios.get("/config");
}

export function createConfig(data) {
  return axios.post("/config", data);
}

export function updateConfig(id, data) {
  return axios.put(`/config/${id}`, data);
}
